﻿<Window x:Class="Xtreem.GoogleSearch.SearchView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Xtreem.GoogleSearch"
        xmlns:as="clr-namespace:Xtreem.GoogleSearch.AutoSuggest"
        Title="Search" Height="500" Width="700">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources\ResourceDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <local:SearchViewModel x:Key="_vm" />
        </ResourceDictionary>
    </Window.Resources>
    
    <Window.DataContext>
        <Binding Source="{StaticResource ResourceKey=_vm}"/>
    </Window.DataContext>

    <DockPanel LastChildFill="True">
        <Grid DockPanel.Dock="Top" Height="85" Background="#F1F1F1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="120" />
            </Grid.ColumnDefinitions>
            <as:AutoSuggestTextBox x:Name="textBox"
                                   Margin="20,20,10,30"
                                   VerticalContentAlignment="Center"
                                   FontSize="18"
                                   Style="{DynamicResource AutoSuggestTextBoxStyle}"
                                   DataProvider="{Binding SuggestionProvider}"/>
            <Button Grid.Column="1"
                    Style="{StaticResource SearchButtonStyle}"
                    Margin="10,20,20,30"
                    IsDefault="True"
                    Command="{Binding Search}"
                    CommandParameter="{Binding Text, ElementName=textBox}">
                <Path Stroke="White" StrokeThickness="3">
                    <Path.Data>
                        <GeometryGroup>
                            <EllipseGeometry Center="5,5" RadiusX="6" RadiusY="6" />
                            <LineGeometry StartPoint="11,11" EndPoint="16,16" />
                        </GeometryGroup>
                    </Path.Data>
                </Path>
            </Button>
        </Grid>
        <WebBrowser ScrollViewer.VerticalScrollBarVisibility="Hidden" local:SearchView.Html="{Binding ResultsHtml}"/>
    </DockPanel>
</Window>
